package com.hison.tandainbao.entiy.pojo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName tb_items
 */
@TableName(value ="tb_items")
@Data
public class TbItems implements Serializable {
    /**
     * 主键自增长
     */
    @TableId
    private Long id;

    /**
     * 发布者id，外键
     */
    private Long userId;

    /**
     * 物品名称
     */
    private String itemName;

    /**
     * 物品描述信息
     */
    private String itemDescription;

    /**
     * 丢失/发现地点
     */
    private String itemLocation;

    /**
     * 丢失/发现 时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date itemTime;

    /**
     * 联系电话
     */
    private String contactPhone;

    /**
     * 微信
     */
    private String contactWechat;

    /**
     * 0失物招领，1寻物启示
     */
    private Integer type;

    private String  itemImages;


    private int auditStatus;
    /**
     * 其他信息
     */
    private String description;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private String  userName;
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbItems other = (TbItems) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
            && (this.getItemDescription() == null ? other.getItemDescription() == null : this.getItemDescription().equals(other.getItemDescription()))
            && (this.getItemLocation() == null ? other.getItemLocation() == null : this.getItemLocation().equals(other.getItemLocation()))
            && (this.getItemTime() == null ? other.getItemTime() == null : this.getItemTime().equals(other.getItemTime()))
            && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
            && (this.getContactWechat() == null ? other.getContactWechat() == null : this.getContactWechat().equals(other.getContactWechat()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
        result = prime * result + ((getItemDescription() == null) ? 0 : getItemDescription().hashCode());
        result = prime * result + ((getItemLocation() == null) ? 0 : getItemLocation().hashCode());
        result = prime * result + ((getItemTime() == null) ? 0 : getItemTime().hashCode());
        result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
        result = prime * result + ((getContactWechat() == null) ? 0 : getContactWechat().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", itemName=").append(itemName);
        sb.append(", itemDescription=").append(itemDescription);
        sb.append(", itemLocation=").append(itemLocation);
        sb.append(", itemTime=").append(itemTime);
        sb.append(", contactPhone=").append(contactPhone);
        sb.append(", contactWechat=").append(contactWechat);
        sb.append(", type=").append(type);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}